package java6;

import java.util.Scanner;
//(���һ�������е����ֵ����Сֵ)
public class Code077 {
	public static void main(String[] args) {
		Scanner input = new Scanner(System.in);
		int max;
		int min;
		int a=1;
		System.out.print("请输入一个整数(输入0结束):      ");
		int num1 = input.nextInt();
		if(num1!=0){
			a=num1;
			max=num1;
			min=max;
			while(a!=0){
				System.out.print("请输入一个整数(输入0结束):      ");
				int num2 = input.nextInt();
				if(num2!=0){
					a=num2;
					if(num2>=max){
						max=num2;
					}
					else if(num2<=min){
						min=num2;
					}
				}else{
					System.out.print("最大值是:  "+max+"\t最小值是:"+min);
					a=num2;
				}
			}
		}else{
			System.out.print("最大值是: 无 "+"\t最小值是: 无");
		}
	}
}
